const mongoose = require('mongoose')

mongoose.connect('mongodb://localhost:27017/job', {
  useNewUrlParser: true,
  useUnifiedTopology: true
})

const db = mongoose.connection;

db.on('open', () => console.log('数据库链接成功'));
db.on('error', () => console.log('数据库链接失败'))